home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / gnome / help / serverguide / C / installation.xml < prev    next >
Encoding:
Extensible Markup Language  |  2009-04-28  |  43.0 KB  |  1,149 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" 
  3.     "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
  4. <!ENTITY % globalent SYSTEM "../../libs/global.ent">
  5. %globalent;
  6. <!ENTITY % gnome-menus-C SYSTEM "../../libs/gnome-menus-C.ent">
  7. %gnome-menus-C;
  8. <!ENTITY % xinclude SYSTEM "../../libs/xinclude.mod">
  9. %xinclude;
  10. <!ENTITY language "&EnglishAmerican;">
  11. ]>
  12. <chapter id="installation" status="review">
  13.     <title>Installation</title>
  14.   <para>
  15.   This chapter provides a quick overview of installing Ubuntu &distro-rev; Server Edition. For more detailed instructions, 
  16.   please refer to the <ulink url="https://help.ubuntu.com/&distro-rev;/installation-guide/">Ubuntu Installation Guide</ulink>.
  17.   </para>
  18.     <sect1 id="preparing-to-install" status="review">
  19.         <title>Preparing to Install</title>
  20.     <para>
  21.       This section explains various aspects to consider before starting the
  22.       installation. </para>
  23.             <sect2 id="system-requirements" status="review">
  24.                 <title>System Requirements</title>
  25.                 <para>Ubuntu &distro-rev; Server Edition supports two (2) major architectures: Intel x86 and AMD64. The table below lists recommended hardware specifications. Depending on your needs, you might manage with less than this. However, most users risk being frustrated if they ignore these suggestions.</para>
  26.                 <table>
  27.                 <title>Recommended Minimum Requirements</title>
  28.                     <tgroup cols="4">
  29.                         <colspec colname="1"/>
  30.                         <colspec colname="2"/>
  31.                         <colspec colname="3" colwidth="2"/>
  32.                         <colspec colname="4"/>
  33.                         <thead>
  34.                             <row>
  35.                                 <entry morerows="1" valign="middle"><para>Install Type</para></entry>
  36.                                 <entry morerows="1" valign="middle"><para>RAM</para></entry>
  37.                                 <entry namest="3" nameend="4" align="center"><para>Hard Drive Space</para></entry>
  38.                             </row>
  39.                              <row>
  40.                                 <entry><para>Base System</para></entry>
  41.                                 <entry><para>All Tasks Installed</para></entry>
  42.                             </row>
  43.                         </thead>
  44.                         <tbody>
  45.                             <row>
  46.                                 <entry><para>Server</para></entry>
  47.                                 <entry><para>128 megabytes</para></entry>
  48.                                 <entry><para>500 megabytes</para></entry>
  49.                                 <entry><para>1 gigabyte</para></entry>
  50.                             </row>
  51.                         </tbody>
  52.                     </tgroup>
  53.                 </table>
  54.                 <para>
  55.                 The Server Edition provides a common base for all sorts of server applications. 
  56.                 It is a minimalist design providing a platform for the desired services, such 
  57.                  as file/print services, web hosting, email hosting, etc. 
  58.                 </para>
  59.             </sect2>
  60.  
  61.   <sect2 id="intro-server-differences" status="review">
  62.     <title>Server and Desktop Differences</title>
  63.     <para>
  64.     There are a few differences between the <emphasis>Ubuntu Server Edition</emphasis> and the 
  65.     <emphasis>Ubuntu Desktop Edition</emphasis>.  It should be noted that both editions use the same 
  66.     <application>apt</application> repositories.  Making it just as easy to install a <emphasis role="italic">server</emphasis> 
  67.     application on the Desktop Edition as it is on the Server Edition.
  68.     </para>
  69.     <para>
  70.     The differences between the two editions are the lack of an X window environment in the Server Edition, 
  71.     the installation process, and different Kernel options.
  72.     </para>    
  73.     <para>
  74.     </para>
  75.     <sect3 id="intro-kernel-diffs" status="review">
  76.       <title>Kernel Differences:</title>
  77.       <itemizedlist>
  78.         <listitem>    
  79.       <para>
  80.       The Server Edition uses the <emphasis>Deadline</emphasis> I/O scheduler instead of the
  81.       <emphasis>CFQ</emphasis> scheduler used by the Desktop Edition.
  82.       </para>
  83.     </listitem>
  84.     <listitem>    
  85.       <para>
  86.       <emphasis>Preemption</emphasis> is turned off in the Server Edition. 
  87.       </para>
  88.     </listitem>
  89.     <listitem>    
  90.       <para>
  91.       The timer interrupt is 100 Hz in the Server Edition and 250 Hz in the Desktop Edition.
  92.       </para>
  93.     </listitem>    
  94.     </itemizedlist>
  95.       <note>
  96.         <para>
  97.         When running a 64-bit version of Ubuntu on 64-bit processors you are not limited by memory addressing space.
  98.         </para>
  99.       </note>
  100.     
  101.     <para>
  102.     To see all kernel configuration options you can look through <filename>/boot/config-&linux-kernel-version;-server</filename>. 
  103.     Also, <ulink url="http://www.kroah.com/lkn/">Linux Kernel in a Nutshell</ulink> is a great resource on the options 
  104.     available.
  105.     </para>
  106.     </sect3>
  107.   </sect2>
  108.  
  109.       <sect2 id="backing-up" status="review">
  110.         <title>Backing Up</title>
  111.           <itemizedlist>
  112.             <listitem>
  113.               <para>
  114.           Before installing <application>Ubuntu Server Edition</application> you should make sure all data on the system 
  115.               is backed up. See <xref linkend="backups"/> for backup options.
  116.           </para>
  117.           <para> 
  118.           If this is not the first time an operating system has been installed on your
  119.               computer, it is likely you will need to re-partition your disk to make room for Ubuntu. 
  120.           </para>
  121.           <para> 
  122.               Any time you partition your disk, you should be prepared to 
  123.               lose everything on the disk should you make a mistake or 
  124.               something goes wrong during partitioning.  The programs used in installation are 
  125.               quite reliable, most have seen years of use, but they 
  126.               also perform destructive actions.
  127.               </para>
  128.             </listitem>
  129.           </itemizedlist>
  130.       </sect2>
  131.     </sect1>
  132.     <sect1 id="installing-from-cd" status="review">
  133.         <title>Installing from CD</title>
  134.       <para>
  135.       The basic steps to install Ubuntu Server Edition from CD are the same for installing any operating system from CD.  Unlike
  136.       the <emphasis>Desktop Edition</emphasis> the <emphasis>Server Edition</emphasis> does not include a graphical 
  137.       installation program.  Instead the Server Edition uses a console menu based process.
  138.       </para>
  139.       <itemizedlist>
  140.         <listitem>
  141.           <para>
  142.           First, download and burn the appropriate ISO file from the <ulink url="http://www.ubuntu.com/getubuntu/download">
  143.           Ubuntu web site</ulink>.
  144.           </para>
  145.         </listitem>
  146.         <listitem>
  147.           <para>
  148.           Boot the system from the CD-ROM drive.
  149.           </para>
  150.         </listitem>
  151.         <listitem>
  152.           <para>
  153.           At the boot prompt you will be asked to select the language.
  154.           Afterwards the installation process begins by asking for your keyboard layout.
  155.           </para>
  156.         </listitem>
  157.         <listitem>
  158.           <para>
  159.           The installer then discovers your hardware configuration, and configures the 
  160.           network settings using DHCP.  If you do not wish to use DHCP at the next screen
  161.               choose "Go Back", and you have the option to "Configure the network manually".
  162.           </para>
  163.         </listitem>
  164.         <listitem>
  165.           <para>
  166.           Next, the installer asks for the system's hostname and Time Zone. 
  167.           </para>
  168.         </listitem>
  169.         <listitem>
  170.           <para>
  171.           You can then choose from several options to configure the hard drive layout.
  172.               For advanced disk options see <xref linkend="advanced-installation"/>.
  173.           </para>
  174.         </listitem>
  175.         <listitem>
  176.           <para>
  177.          The Ubuntu base system is then installed.
  178.           </para>
  179.         </listitem>
  180.         <listitem>
  181.           <para>
  182.           A new user is setup, this user will have <emphasis>root</emphasis> access
  183.           through the <application>sudo</application> utility.
  184.           </para>
  185.         </listitem>
  186.         <listitem>
  187.           <para>
  188.               After the user is setup, you will be asked to encrypt your 
  189.               <filename role="directory">home</filename> directory. 
  190.           </para>
  191.         </listitem>
  192.         <listitem>
  193.           <para>
  194.               The next step in the installation process is to decide how you want to update the system.
  195.               There are three options: 
  196.           </para>
  197.                 <itemizedlist>
  198.                   <listitem>
  199.                     <para>
  200.                     <emphasis>No automatic updates</emphasis>: this requires an administrator to log into
  201.                     the machine and manually install updates.
  202.                     </para>
  203.                   </listitem>
  204.                   <listitem>
  205.                     <para>
  206.                     <emphasis>Install security updates Automatically</emphasis>: will install the 
  207.                     <application>unattended-upgrades</application> package, which will install security updates without the intervention
  208.                     of an administrator.  For more details see <xref linkend="automatic-updates"/>.
  209.                     </para>
  210.                   </listitem>
  211.                   <listitem>
  212.                     <para>
  213.                     <emphasis>Manage the system with Landscape</emphasis>: Landscape is a paid service provided
  214.                     by Canonical to help manager your Ubuntu machines.  See the 
  215.                     <ulink url="http://www.canonical.com/projects/landscape">Landscape</ulink> site for details.
  216.                     </para>
  217.                   </listitem>
  218.                 </itemizedlist>
  219.         </listitem>
  220.         <listitem>
  221.           <para>
  222.           You now have the option to install, or not install, several package tasks.  See 
  223.           <xref linkend="install-tasks"/> for details.  Also, there is an option to launch
  224.               <application>aptitude</application> to choose specific packages to install.  For more
  225.               information see <xref linkend="aptitude"/>.
  226.           </para>
  227.         </listitem>
  228.         <listitem>
  229.           <para>
  230.           Finally, the last step before rebooting is to set the clock to UTC.
  231.           </para>
  232.         </listitem>
  233.       </itemizedlist>
  234.       <note>
  235.         <para>
  236.             If at any point during installation you are not satisfied by the default setting, use the "Go Back" function at 
  237.             any prompt to be brought to a detailed installation menu that will allow you to modify the default settings.
  238.         </para>
  239.       </note>
  240.           <para>
  241.           At some point during the installation process you may want to
  242.           read the help screen provided by the installation system. To
  243.           do this, press F1.
  244.           </para>
  245.       <para>
  246.       Once again, for detailed instructions see the <ulink url="https://help.ubuntu.com/&distro-rev;/installation-guide/">
  247.       Ubuntu Installation Guide</ulink>.
  248.       </para>
  249.        
  250.       <sect2 id="install-tasks" status="review">
  251.         <title>Package Tasks</title>
  252.         <para>
  253.         During the Server Edition installation you have the option of installing additional packages from the CD.  The packages
  254.         are grouped by the type of service they provide. 
  255.         </para>
  256.         <itemizedlist>
  257.           <listitem>
  258.             <para>
  259.         DNS server: Selects the BIND DNS server and its documentation.
  260.             </para>
  261.           </listitem>
  262.           <listitem>
  263.             <para>
  264.         LAMP server: Selects a ready-made Linux/Apache/MySQL/PHP server.    
  265.             </para>
  266.           </listitem>
  267.           <listitem>
  268.             <para>
  269.         Mail server: This task selects a variety of package useful for a general purpose mail  server system.
  270.             </para>
  271.           </listitem>
  272.           <listitem>
  273.             <para>
  274.         OpenSSH server: Selects packages needed for an OpenSSH server.
  275.             </para>
  276.           </listitem>
  277.           <listitem>
  278.             <para>
  279.         PostgreSQL database: This task selects client and server packages for the PostgreSQL database.
  280.             </para>
  281.           </listitem>
  282.           <listitem>
  283.             <para>
  284.         Print server: This task sets up your system to be a print server.
  285.             </para>
  286.           </listitem>
  287.           <listitem>
  288.             <para>
  289.         Samba File server: This task sets up your system to be a Samba file server, which is 
  290.         especially suitable in networks with both Windows and Linux systems.
  291.             </para>
  292.           </listitem>
  293.           <listitem>
  294.             <para>
  295.         Tomcat server: Installs the Apache Tomcat and needed dependencies Java, gcj, etc.
  296.             </para>
  297.           </listitem>
  298.           <listitem>
  299.             <para>
  300.         Virtual machine host: Includes packages needed to run KVM virtual machines.
  301.             </para>
  302.           </listitem>
  303.         </itemizedlist>
  304.           <para>
  305.         Installing the package groups is accomplished using the <application>tasksel</application> utility.  
  306.         One of the important difference between Ubuntu (or Debian) and other GNU/Linux distribution is that, when 
  307.             installed, a package is also configured to reasonable defaults, eventually prompting you for additional required 
  308.             information. Likewise, when installing a task, the packages are not only installed, but also configured to provided
  309.             a fully integrated service.
  310.         </para>
  311.         <para>
  312.             Once the installation process has finished you can view a list of available tasks by entering the following from a 
  313.             terminal prompt:
  314.         </para>
  315. <screen>
  316. <command>tasksel --list-tasks</command>
  317. </screen>
  318.         <note>
  319.           <para>
  320.           The output will list tasks from other Ubuntu based distributions such as Kubuntu and Edubuntu.
  321.           Note that you can also invoke the <command>tasksel</command> command by itself, which will bring up a menu 
  322.               of the different tasks available.
  323.           </para>
  324.         </note>
  325.         <para>
  326.         You can view a list of which packages are installed with each task using the <emphasis>--task-packages</emphasis> option. 
  327.         For example, to list the packages installed with the <emphasis>DNS Server</emphasis> task enter the following:
  328.         </para>
  329. <screen>
  330. <command>tasksel --task-packages dns-server</command>
  331. </screen>    
  332.         <para>
  333.         The output of the command should list:
  334.         </para>
  335. <programlisting>
  336. bind9-doc
  337. bind9
  338. </programlisting>
  339.         <para>
  340.         Also, if you did not install one of the tasks during the installation process, but for example you decide to make your new LAMP server 
  341.         a DNS server as well.  Simply insert the installation CD and from a terminal:
  342.         </para>
  343. <screen>
  344. <command>sudo tasksel install dns-server</command>
  345. </screen>
  346.       </sect2>
  347.     </sect1>
  348.     <sect1 id="installing-upgrading" status="review">
  349.       <title>Upgrading</title>
  350.       <para>
  351.       There are several ways to upgrade from one Ubuntu release to another.  This section gives an overview of the recommended upgrade method.
  352.       </para>
  353.       <sect2 id="do-release-upgrade" status="review">
  354.         <title>do-release-upgrade</title>
  355.         <para>
  356.         The recommended way to upgrade a Server Edition installation is to use the <application>do-release-upgrade</application> utility.
  357.         Part of the <emphasis>update-manager-core</emphasis> package, it does not have any graphical dependencies and 
  358.     is installed by default.
  359.         </para>
  360.     <para>
  361.     Debian based systems can also be upgraded by using <command>apt-get dist-upgrade</command>. However, using 
  362.     <application>do-release-upgrade</application> is recommended because it has the ability to handle system configuration
  363.     changes sometimes needed between releases.
  364.     </para>
  365.     <para>
  366.     To upgrade to a newer release, from a terminal prompt enter:
  367.     </para>
  368. <screen>
  369. <command>do-release-upgrade</command>
  370. </screen>
  371.     <para>
  372.     It is also possible to use <application>do-release-upgrade</application> to upgrade to a development version of 
  373.     Ubuntu.  To accomplish this use the <emphasis>-d</emphasis> switch:
  374.     </para>
  375. <screen>
  376. <command>do-release-upgrade -d</command>
  377. </screen>
  378.     <warning>
  379.       <para>
  380.       Upgrading to a development release is <emphasis>not</emphasis> recommended for production environments.
  381.       </para>
  382.     </warning>
  383.       </sect2>
  384.     </sect1>
  385.     <sect1 id="advanced-installation" status="review">
  386.       <title>Advanced Installation</title>
  387.  
  388.       <sect2 id="software-raid" status="review">
  389.         <title>Software RAID</title>
  390.  
  391.         <para>
  392.         RAID is a method of configuring multiple hard drives to act as one, reducing the 
  393.         probability of catastrophic data loss in case of drive failure. RAID is implemented in either software 
  394.         (where the operating system knows about both drives and actively maintains both of them) or hardware 
  395.         (where a special controller makes the OS think there's only one drive and maintains the drives 'invisibly').
  396.         </para>
  397.  
  398.         <para>
  399.         The RAID software included with current versions of Linux (and Ubuntu) is based on the <application>'mdadm'</application>
  400.         driver and works very well, better even than many so-called 'hardware' RAID controllers.  This section will guide you 
  401.         through installing Ubuntu Server Edition using two RAID1 partitions on two physical hard drives, one for 
  402.         <emphasis>/</emphasis> and another for <emphasis>swap</emphasis>.
  403.         </para>
  404.  
  405.         <sect3 id="raid-partitioning" status="review">
  406.           <title>Partitioning</title>
  407.  
  408.           <para>
  409.           Follow the installation steps until you get to the <emphasis>Partition disks</emphasis> step, then:
  410.           </para>
  411.  
  412.           <procedure>
  413.             <step>
  414.  
  415.               <para>
  416.               Select <emphasis>Manual</emphasis> as the partition method.
  417.               </para>
  418.  
  419.             </step>
  420.             <step>
  421.  
  422.               <para>
  423.               Select the first hard drive, and agree to <emphasis>"Create a new empty partition table on this device?"</emphasis>.
  424.               </para>
  425.  
  426.               <para>
  427.               Repeat this step for each drive you wish to be part of the RAID array.
  428.               </para>
  429.  
  430.             </step>
  431.             <step>
  432.  
  433.               <para>
  434.               Select the <emphasis>"FREE SPACE"</emphasis> on the first drive then select <emphasis>"Create a new partition"</emphasis>. 
  435.               </para>
  436.  
  437.             </step>
  438.             <step>
  439.  
  440.               <para>
  441.               Next, select the <emphasis>Size</emphasis> of the partition.  This partition will be the <emphasis>swap</emphasis> partition,
  442.               and a general rule for swap size is twice that of RAM.  Enter the partition size, then choose <emphasis>Primary</emphasis>,
  443.               then <emphasis>Beginning</emphasis>. 
  444.               </para>
  445.  
  446.             </step>
  447.             <step>
  448.  
  449.               <para>
  450.               Select the <emphasis>"Use as:"</emphasis> line at the top.  By default this is 
  451.               <emphasis role="italic">"Ext3 journaling file system"</emphasis>, change that to <emphasis>"physical volume for RAID"</emphasis>
  452.               then <emphasis>"Done setting up partition"</emphasis>. 
  453.               </para>
  454.  
  455.             </step>
  456.             <step>
  457.  
  458.               <para>
  459.               For the <emphasis>/</emphasis> partition once again select <emphasis>"Free Space"</emphasis> on the first drive then
  460.               <emphasis>"Create a new partition"</emphasis>. 
  461.               </para>
  462.  
  463.             </step>
  464.             <step>
  465.  
  466.               <para>
  467.               Use the rest of the free space on the drive and choose <emphasis>Continue</emphasis>, then <emphasis>Primary</emphasis>. 
  468.               </para>
  469.  
  470.             </step>
  471.             <step>
  472.  
  473.               <para>
  474.               As with the swap partition, select the <emphasis>"Use as:"</emphasis> line at the top, changing it to 
  475.               <emphasis>"physical volume for RAID"</emphasis> then choose <emphasis>"Done setting up partition"</emphasis>. 
  476.               </para>
  477.  
  478.             </step>
  479.             <step>
  480.  
  481.               <para>
  482.               Repeat steps three through eight for the other disk and partitions. 
  483.               </para>
  484.  
  485.             </step>
  486.           </procedure>
  487.  
  488.         </sect3>
  489.         <sect3 id="raid-configuration" status="review">
  490.           <title>RAID Configuration</title>
  491.  
  492.           <para>
  493.           With the partitions setup the arrays are ready to be configured:
  494.           </para>
  495.  
  496.           <procedure>
  497.             <step>
  498.  
  499.               <para>
  500.               Back in the main "Partition Disks" page, select <emphasis>"Configure Software RAID"</emphasis> at the top.
  501.               </para>
  502.  
  503.             </step>
  504.             <step>
  505.  
  506.               <para>
  507.               Select <emphasis>"yes"</emphasis> to write the changes to disk.
  508.               </para>
  509.  
  510.             </step>
  511.             <step>
  512.  
  513.               <para>
  514.               Choose <emphasis>"Create MD drive"</emphasis>.
  515.               </para>
  516.  
  517.             </step>
  518.             <step>
  519.  
  520.               <para>
  521.               For this example, select <emphasis>"RAID1"</emphasis>, but if you are using a different setup choose the appropriate type 
  522.               (RAID0 RAID1 RAID5).
  523.               </para>
  524.  
  525.               <note>
  526.                 <para>
  527.                 In order to use <emphasis>RAID5</emphasis> you need at least <emphasis>three</emphasis> drives.  Using RAID0 or RAID1
  528.                 only <emphasis>two</emphasis> drives are required.
  529.                 </para>
  530.               </note>
  531.  
  532.             </step>
  533.             <step>
  534.  
  535.               <para>
  536.               Enter the number of active devices <emphasis>"2"</emphasis>, or the amount of hard drives you have, for the array.  Then 
  537.               select <emphasis>"Continue"</emphasis>.
  538.               </para>
  539.  
  540.             </step>
  541.             <step>
  542.  
  543.               <para>
  544.               Next, enter the number of spare devices <emphasis>"0"</emphasis> by default, then choose <emphasis>"Continue"</emphasis>.
  545.               </para>
  546.  
  547.             </step>
  548.             <step>
  549.  
  550.               <para>
  551.               Choose which partitions to use. Generally they will be sda1, sdb1, sdc1, etc. The numbers will usually match and the different 
  552.               letters correspond to different hard drives.  
  553.               </para>
  554.  
  555.               <para>
  556.               For the <emphasis>swap</emphasis> partition choose <emphasis>sda1</emphasis> and <emphasis>sdb1</emphasis>.
  557.               Select <emphasis>"Continue"</emphasis> to go to the next step.
  558.               </para>
  559.  
  560.             </step>
  561.             <step>
  562.  
  563.               <para>
  564.               Repeat steps <emphasis>three</emphasis> through <emphasis>seven</emphasis> for the <emphasis>/</emphasis> partition choosing 
  565.               <emphasis>sda2</emphasis> and <emphasis>sdb2</emphasis>.
  566.               </para>
  567.  
  568.             </step>
  569.             <step>
  570.  
  571.               <para>
  572.               Once done select <emphasis>"Finish"</emphasis>.
  573.               </para>
  574.  
  575.             </step>
  576.  
  577.           </procedure>
  578.  
  579.         </sect3>
  580.         <sect3 id="raid-formatting" status="review">
  581.           <title>Formatting</title>
  582.  
  583.           <para>
  584.           There should now be a list of hard drives and RAID devices. The next step is to format and set the mount point for the RAID devices.
  585.           Treat the RAID device as a local hard drive, format and mount accordingly.
  586.           </para>
  587.  
  588.           <procedure>
  589.             <step>
  590.  
  591.               <para>
  592.               Select the <emphasis>RAID1 device #0</emphasis> partition. 
  593.               </para>
  594.  
  595.             </step>
  596.             <step>
  597.  
  598.               <para>
  599.               Choose <emphasis>"Use as:"</emphasis>.  Then select <emphasis>"swap area"</emphasis>, then 
  600.               <emphasis>"Done setting up partition"</emphasis>.
  601.               </para>
  602.  
  603.             </step>
  604.             <step>
  605.  
  606.               <para>
  607.               Next, select the <emphasis>RAID1 device #1</emphasis> partition. 
  608.               </para>
  609.  
  610.             </step>
  611.             <step>
  612.  
  613.               <para>
  614.               Choose <emphasis>"Use as:"</emphasis>.  Then select <emphasis>"Ext3 journaling file system"</emphasis>.
  615.               </para>
  616.  
  617.             </step>
  618.             <step>
  619.  
  620.               <para>
  621.               Then select the <emphasis>"Mount point"</emphasis> and choose <emphasis>"/ - the root file system"</emphasis>.
  622.               Change any of the other options as appropriate, then select <emphasis>"Done setting up partition"</emphasis>.
  623.               </para>
  624.  
  625.             </step>
  626.             <step>
  627.  
  628.               <para>
  629.               Finally, select <emphasis>"Finish partitioning and write changes to disk"</emphasis>.
  630.               </para>
  631.  
  632.             </step>
  633.           </procedure>
  634.  
  635.           <para>
  636.           If you choose to place the root partition on a RAID array, the installer will then ask if you would like to boot in
  637.           a <emphasis>degraded</emphasis> state.  See <xref linkend="raid-degraded"/> for further details.  
  638.           </para>
  639.  
  640.           <para>
  641.           The installation process will then continue normally.
  642.           </para>
  643.  
  644.         </sect3>
  645.         <sect3 id="raid-degraded" status="review">
  646.           <title>Degraded RAID</title>
  647.  
  648.           <para>
  649.           At some point in the life of the computer a disk failure event may occur.  When this happens, using Software RAID, the operating
  650.           system will place the array into what is known as a <emphasis>degraded</emphasis> state.
  651.           </para>
  652.  
  653.           <para>
  654.           If the array has become degraded, due to the chance of data corruption, by default Ubuntu Server Edition will boot 
  655.           to <emphasis>initramfs</emphasis> after thirty seconds.  Once the initramfs has booted there is a fifteen second 
  656.           prompt giving you the option to go ahead and boot the system, or attempt manual recover.  Booting to the initramfs
  657.           prompt may or may not be the desired behavior, especially if the machine is in a remote location.  Booting to a 
  658.           degraded array can be configured several ways:
  659.           </para>
  660.  
  661.           <itemizedlist>
  662.             <listitem>
  663.  
  664.               <para>
  665.               The <application>dpkg-reconfigure</application> utility can be used to configure the default behavior, and 
  666.               during the process you will be queried about additional settings related to the array.  Such as monitoring, email 
  667.               alerts, etc.  To reconfigure <application>mdadm</application> enter the following:  
  668.               </para>
  669.  
  670. <screen>
  671. <command>sudo dpkg-reconfigure mdadm</command>
  672. </screen>
  673.  
  674.              </listitem>
  675.             <listitem>
  676.  
  677.               <para>
  678.               The <command>dpkg-reconfigure mdadm</command> process will change the <filename>/etc/initramfs-tools/conf.d/mdadm</filename>
  679.               configuration file.  The file has the advantage of being able to pre-configure the system's behavior, and can also be manually
  680.               edited:
  681.               </para>
  682.  
  683. <programlisting>
  684. BOOT_DEGRADED=true
  685. </programlisting>
  686.  
  687.           <note>
  688.             <para>
  689.             The configuration file can be overridden by using a Kernel argument.
  690.             </para>
  691.           </note>          
  692.  
  693.             </listitem>
  694.             <listitem>
  695.     
  696.               <para>
  697.               Using a Kernel argument will allow the system to boot to a degraded array as well:
  698.               </para>
  699.  
  700.               <itemizedlist>
  701.                 <listitem>
  702.                   <para>
  703.                   When the server is booting press <emphasis>ESC</emphasis> to open the <application>Grub</application> menu.
  704.                   </para>
  705.                 </listitem>
  706.                 <listitem>
  707.                   <para>
  708.                   Press <emphasis>"e"</emphasis> to edit your Kernel command options.
  709.                   </para>
  710.                 </listitem>
  711.                 <listitem>
  712.                   <para>
  713.                   Press the <emphasis>DOWN</emphasis> arrow to highlight the kernel line.
  714.                   </para>
  715.                 </listitem>
  716.                 <listitem>
  717.                   <para>
  718.                   Press the <emphasis>"e"</emphasis> key again to edit the kernel line.
  719.                   </para>
  720.                 </listitem>
  721.                 <listitem>
  722.                   <para>
  723.                   Add <emphasis>"bootdegraded=true"</emphasis> (without the quotes) to the end of the line.
  724.                   </para>
  725.                 </listitem>
  726.                 <listitem>
  727.                   <para>
  728.                   Press <emphasis>"ENTER"</emphasis>.
  729.                   </para>
  730.                 </listitem>
  731.                 <listitem>
  732.                   <para>
  733.                   Finally, press <emphasis>"b"</emphasis> to boot the system.
  734.                   </para>
  735.                 </listitem>
  736.               </itemizedlist>
  737.  
  738.             </listitem>
  739.            </itemizedlist>
  740.  
  741.            <para>
  742.            Once the system has booted you can either repair the array see <xref linkend="raid-maintenance"/> for details, or copy 
  743.            important data to another machine due to major hardware failure.
  744.            </para>
  745.  
  746.         </sect3>
  747.         <sect3 id="raid-maintenance">
  748.           <title>RAID Maintenance</title>
  749.  
  750.           <para>
  751.           The <application>mdadm</application> utility can be used to view the status of an array, add disks to an array, remove 
  752.           disks, etc:
  753.           </para>
  754.  
  755.           <itemizedlist>
  756.             <listitem>
  757.               <para>
  758.               To view the status of an array, from a terminal prompt enter:
  759.               </para>
  760. <screen>
  761. <command>sudo mdadm -D /dev/md0</command>
  762. </screen>
  763.             
  764.               <para>
  765.               The <emphasis>-D</emphasis> tells <application>mdadm</application> to display <emphasis>detailed</emphasis> information
  766.               about the <filename>/dev/md0</filename> device.  Replace <filename>/dev/md0</filename> with the appropriate RAID device.
  767.               </para>
  768.             </listitem>
  769.             <listitem>
  770.               <para>
  771.               To view the status of a disk in an array:
  772.               </para>
  773. <screen>
  774. <command>sudo mdadm -E /dev/sda1</command>
  775. </screen>
  776.               <para>
  777.               The output if very similar to the <command>mdadm -D</command> command, adjust <filename>/dev/sda1</filename> for each disk.
  778.               </para>
  779.             </listitem>
  780.             <listitem>
  781.               <para>
  782.               If a disk fails and needs to be removed from an array enter:
  783.               </para>
  784. <screen>
  785. <command>sudo mdadm --remove /dev/md0 /dev/sda1</command>
  786. </screen>
  787.               <para>
  788.               Change <filename>/dev/md0</filename> and <filename>/dev/sda1</filename> to the appropriate RAID device and disk.
  789.               </para>
  790.             </listitem>
  791.             <listitem>
  792.               <para>
  793.               Similarly, to add a new disk:
  794.               </para>
  795. <screen>
  796. <command>sudo mdadm --add /dev/md0 /dev/sda1</command>
  797. </screen>
  798.             </listitem>
  799.           </itemizedlist>
  800.  
  801.           <para>
  802.           Sometimes a disk can change to a <emphasis>faulty</emphasis> state even though there is nothing physically wrong with the drive. 
  803.           It is usually worthwhile to remove the drive from the array then re-add it.  This will cause the drive to re-sync with the array.
  804.           If the drive will not sync with the array, it is a good indication of hardware failure.
  805.           </para>
  806.  
  807.           <para>
  808.           The <filename>/proc/mdstat</filename> file also contains useful information about the system's RAID devices:
  809.           </para>
  810.  
  811. <screen>
  812. <command>cat /proc/mdstat</command>
  813. <computeroutput>Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] 
  814. md0 : active raid1 sda1[0] sdb1[1]
  815.       10016384 blocks [2/2] [UU]
  816.       
  817. unused devices: <none></computeroutput>
  818. </screen>
  819.  
  820.           <para>
  821.           The following command is great for watching the status of a syncing drive:
  822.           </para>
  823.  
  824. <screen>
  825. <command>watch -n1 cat /proc/mdstat</command>
  826. </screen>
  827.  
  828.           <para>
  829.           Press <emphasis>Ctrl+c</emphasis> to stop the <application>watch</application> command.
  830.           </para>
  831.  
  832.           <para>
  833.           If you do need to replace a faulty drive, after the drive has been replaced and synced, <application>grub</application> will need to be 
  834.           installed.  To install <application>grub</application> on the new drive, enter the following:
  835.           </para>
  836.  
  837. <screen>
  838. <command>sudo grub-install /dev/md0</command>
  839. </screen>
  840.  
  841.           <para>
  842.           Replace <filename>/dev/md0</filename> with the appropriate array device name.
  843.           </para>
  844.  
  845.         </sect3>
  846.         <sect3 id="raid-resources" status="review">
  847.           <title>Resources</title>
  848.  
  849.           <para>
  850.           The topic of RAID arrays is a complex one due to the plethora of ways RAID can be configured.  Please see the following links for 
  851.           more information:
  852.           </para>
  853.  
  854.           <itemizedlist>
  855.             <listitem>
  856.               <para>
  857.               <ulink url="http://www.faqs.org/docs/Linux-HOWTO/Software-RAID-HOWTO.html">Software RAID HOWTO</ulink>
  858.               </para>
  859.             </listitem>
  860.             <listitem>
  861.               <para>
  862.               <ulink url="http://oreilly.com/catalog/9781565927308/">Managing RAID on Linux</ulink>
  863.               </para>
  864.             </listitem>
  865.           </itemizedlist>
  866.         </sect3>
  867.       </sect2>  
  868.       <sect2 id="lvm" status="review">
  869.         <title>Logical Volume Manager (LVM)</title>
  870.  
  871.         <para>
  872.         Logical Volume Manger, or <emphasis>LVM</emphasis>, allows administrators to create <emphasis>logical</emphasis> volumes out of
  873.         one or multiple physical hard disks.  LVM volumes can be created on both software RAID partitions and standard partitions 
  874.         residing on a single disk.  Volumes can also be extended, giving greater flexibility to systems as requirements change.
  875.         </para>
  876.  
  877.         <sect3 id="lvm-overview" status="review">
  878.           <title>Overview</title>
  879.  
  880.           <para>
  881.           A side effect of LVM's power and flexibility is a greater degree of complication.  Before diving into the LVM installation process,
  882.           it is best to get familiar with some terms.
  883.           </para>
  884.  
  885.           <itemizedlist>
  886.             <listitem>
  887.               <para>
  888.               <emphasis>Volume Group (VG):</emphasis> contains one or several Logical Volumes (LV). 
  889.               </para>
  890.             </listitem>
  891.             <listitem>
  892.               <para>
  893.               <emphasis>Logical Volume (LV):</emphasis> is similar to a partition in a non-LVM system.  Multiple Physical Volumes (PV) 
  894.               can make up one LV, on top of which resides the actual EXT3, XFS, JFS, etc filesystem.
  895.               </para>
  896.             </listitem>
  897.             <listitem>
  898.               <para>
  899.               <emphasis>Physical Volume (PV):</emphasis> physical hard disk or software RAID partition.  The Volume Group can be extended
  900.               by adding more PVs.
  901.               </para>
  902.             </listitem>
  903.           </itemizedlist>
  904.  
  905.         </sect3>
  906.         <sect3 id="lvm-installation" status="review">
  907.           <title>Installation</title>
  908.  
  909.           <para>
  910.           As an example this section covers installing Ubuntu Server Edition with <filename role="directory">/srv</filename> mounted
  911.           on a LVM volume.  During the initial install only one Physical Volume (PV) will be part of the Volume Group (VG).  Another
  912.           PV will be added after install to demonstrate how a VG can be extended.
  913.           </para>
  914.  
  915.           <para>
  916.           There are several installation options for LVM, <emphasis>"Guided - use the entire disk and setup LVM"</emphasis> which will
  917.           also allow you to assign a portion of the available space to LVM, <emphasis>"Guided - use entire and setup encrypted LVM"</emphasis>,
  918.           or <emphasis>Manually</emphasis> setup the partitions and configure LVM.  At this time the only way to configure a system with 
  919.           both LVM and standard partitions, during installation, is to use the Manual approach.
  920.           </para>
  921.  
  922.           <procedure>
  923.             <step>
  924.  
  925.               <para>
  926.               Follow the installation steps until you get to the <emphasis>Partition disks</emphasis> step, then:
  927.               </para>
  928.  
  929.             </step>
  930.             <step>
  931.  
  932.               <para>
  933.               At the <emphasis>"Partition Disks</emphasis> screen choose <emphasis>"Manual"</emphasis>.
  934.               </para>
  935.  
  936.             </step>
  937.             <step>
  938.  
  939.               <para>
  940.               Select the hard disk and on the next screen choose "yes" to <emphasis>"Create a new empty partition table on this device"</emphasis>.
  941.               </para>
  942.  
  943.             </step>
  944.             <step>
  945.  
  946.               <para>
  947.               Next, create standard <emphasis>/boot</emphasis>, <emphasis>swap</emphasis>, and <emphasis>/</emphasis> partitions with whichever
  948.               filesystem you prefer.
  949.               </para>
  950.  
  951.             </step>
  952.             <step>
  953.  
  954.               <para>
  955.               For the LVM <emphasis>/srv</emphasis>, create a new <emphasis>Logical</emphasis> partition.  Then change <emphasis>"Use as"</emphasis>
  956.               to <emphasis>"physical volume for LVM"</emphasis> then <emphasis>"Done setting up the partition"</emphasis>.
  957.               </para>
  958.  
  959.             </step>
  960.             <step>
  961.  
  962.               <para>
  963.               Now select <emphasis>"Configure the Logical Volume Manager"</emphasis> at the top, and choose <emphasis>"Yes"</emphasis> to write 
  964.               the changes to disk.
  965.               </para>
  966.  
  967.             </step>
  968.             <step>
  969.  
  970.               <para>
  971.               For the <emphasis>"LVM configuration action"</emphasis> on the next screen, choose <emphasis>"Create volume group"</emphasis>.  Enter
  972.               a name for the VG such as <emphasis>vg01</emphasis>, or something more descriptive. After entering a name, select the partition 
  973.               configured for LVM, and choose <emphasis>"Continue"</emphasis>.
  974.               </para>
  975.  
  976.             </step>
  977.             <step>
  978.  
  979.               <para>
  980.               Back at the <emphasis>"LVM configuration action"</emphasis> screen, select <emphasis>"Create logical volume"</emphasis>.  Select 
  981.               the newly created volume group, and enter a name for the new LV, for example <emphasis>srv</emphasis> since that is the intended
  982.               mount point.  Then choose a size, which may be the full partition because it can always be extended later. Choose 
  983.               <emphasis>"Finish"</emphasis> and you should be back at the main <emphasis>"Partition Disks"</emphasis> screen.    
  984.               </para>
  985.  
  986.             </step>
  987.             <step>
  988.  
  989.               <para>
  990.               Now add a filesystem to the new LVM.  Select the partition under <emphasis>"LVM VG vg01, LV srv"</emphasis>, or whatever name
  991.               you have chosen, the choose <emphasis>Use as</emphasis>.  Setup a file system as normal selecting <emphasis>/srv</emphasis> as
  992.               the mount point.  Once done, select <emphasis>"Done setting up the partition"</emphasis>.
  993.               </para>
  994.  
  995.             </step>
  996.             <step>
  997.  
  998.               <para>
  999.               Finally, select <emphasis>"Finish partitioning and write changes to disk"</emphasis>.  Then confirm the changes and continue
  1000.               with the rest of the installation.
  1001.               </para>
  1002.  
  1003.             </step>
  1004.           </procedure>
  1005.  
  1006.           <para>
  1007.           There are some useful utilities to view information about LVM: 
  1008.           </para>
  1009.  
  1010.           <itemizedlist>
  1011.             <listitem><para><emphasis>vgdisplay:</emphasis> shows information about Volume Groups.</para></listitem>
  1012.             <listitem><para><emphasis>lvdisplay:</emphasis> has information about Logical Volumes.</para></listitem>
  1013.             <listitem><para><emphasis>pvdisplay:</emphasis> similarly displays information about Physical Volumes.</para></listitem>
  1014.           </itemizedlist>
  1015.  
  1016.         </sect3>
  1017.         <sect3 id="lvm-extending" status="review">
  1018.           <title>Extending Volume Groups</title>
  1019.  
  1020.           <para>
  1021.           Continuing with <emphasis>srv</emphasis> as an LVM volume example, this section covers adding a second hard disk, creating
  1022.           a Physical Volume (PV), adding it to the volume group (VG), extending the logical volume <filename role="directory">srv</filename>
  1023.           and finally extending the filesystem. This example assumes a second hard disk has been added to the system. This hard disk will be 
  1024.           named <filename>/dev/sdb</filename> in our example. BEWARE: make sure you don't already have an existing <filename>/dev/sdb</filename>
  1025.           before issuing the commands below. You could lose some data if you issue those commands on a non-empty disk. In our example we will 
  1026.           use the entire disk as a physical volume (you could choose to create partitions and use them as different physical volumes)
  1027.           </para>
  1028.  
  1029.           <procedure>
  1030.             <step>
  1031.  
  1032.               <para>
  1033.               First, create the physical volume, in a terminal execute:
  1034.               </para>
  1035.  
  1036. <screen>
  1037. <command>sudo pvcreate /dev/sdb</command>
  1038. </screen>
  1039.  
  1040.             </step>
  1041.             <step>
  1042.  
  1043.               <para>
  1044.               Now extend the Volume Group (VG):
  1045.               </para>
  1046.  
  1047. <screen>
  1048. <command>sudo vgextend vg01 /dev/sdb</command>
  1049. </screen>
  1050.  
  1051.             </step>
  1052.             <step>
  1053.  
  1054.               <para>
  1055.               Use <application>vgdisplay</application> to find out the free physical extents - Free PE / size (the size you can allocate). 
  1056.               We will assume a free size of 511 PE (equivalent to 2GB with a PE size of 4MB) and we will use the whole free space available.
  1057.               Use your own PE and/or free space.
  1058.               </para>
  1059.  
  1060.               <para>
  1061.               The Logical Volume (LV) can now be extended by different methods, we will only see how to use the PE to extend the LV:
  1062.               </para>
  1063.  
  1064. <screen>
  1065. <command>sudo lvextend /dev/vg01/srv -l +511</command>
  1066. </screen>
  1067.  
  1068.               <para>
  1069.               The <emphasis>-l</emphasis> option allows the LV to be extended using PE.
  1070.               The <emphasis>-L</emphasis> option allows the LV to be extended using Meg, Gig, Tera, etc bytes.
  1071.               </para>
  1072.  
  1073.             </step>
  1074.             <step>
  1075.  
  1076.               <para>
  1077.               Even though you are supposed to be able to <emphasis>expand</emphasis> an ext3 or ext4 filesystem without unmounting it first, 
  1078.               it may be a good pratice to unmount it anyway and check the filesystem, so that you don't mess up the day you want to reduce
  1079.               a logical volume (in that case unmounting first is compulsory).
  1080.               </para>
  1081.  
  1082.               <para>
  1083.               The following commands are for an <emphasis>EXT3</emphasis> or <emphasis>EXT4</emphasis> filesystem. If you are
  1084.               using another filesystem there may be other utilities available.
  1085.               </para>
  1086.  
  1087. <screen>
  1088. <command>sudo umount /srv</command>
  1089. <command>sudo e2fsck -f /dev/vg01/srv</command>
  1090. </screen>
  1091.  
  1092.               <para>
  1093.               The <emphasis>-f</emphasis> option of <application>e2fsck</application> forces checking even if the system seems clean.
  1094.               </para>
  1095.  
  1096.             </step>
  1097.             <step>
  1098.  
  1099.               <para>
  1100.               Finally, resize the filesystem:
  1101.               </para>
  1102.  
  1103. <screen>
  1104. <command>sudo resize2fs /dev/vg01/srv</command>
  1105. </screen>
  1106.  
  1107.             </step>
  1108.             <step>
  1109.  
  1110.               <para>
  1111.               Now mount the partition and check its size.
  1112.               </para>
  1113.  
  1114. <screen>
  1115. <command>mount /dev/vg01/srv /srv && df -h /srv</command>
  1116. </screen>
  1117.  
  1118.             </step>
  1119.           </procedure>
  1120.  
  1121.         </sect3>
  1122.         <sect3 id="lvm-resources" status="review">
  1123.           <title>Resources</title>
  1124.  
  1125.           <itemizedlist>
  1126.             <listitem>
  1127.               <para>
  1128.               See the <ulink url="http://tldp.org/HOWTO/LVM-HOWTO/index.html">LVM HOWTO</ulink> for more information.
  1129.               </para>
  1130.             </listitem>
  1131.             <listitem>
  1132.               <para>
  1133.               Another good article is 
  1134.               <ulink url="http://www.linuxdevcenter.com/pub/a/linux/2006/04/27/managing-disk-space-with-lvm.html">Managing Disk Space with LVM</ulink>
  1135.               on O'Reilly's linuxdevcenter.com site.
  1136.               </para>
  1137.             </listitem>
  1138.             <listitem>
  1139.               <para>
  1140.               For more information on <application>fdisk</application> see the
  1141.               <ulink url="http://manpages.ubuntu.com/manpages/jaunty/en/man8/fdisk.8.html">fdisk man page</ulink>.
  1142.               </para>
  1143.             </listitem>
  1144.           </itemizedlist>
  1145.         </sect3>
  1146.       </sect2>     
  1147.     </sect1>
  1148. </chapter>
  1149.